/*
 * TipText.fx
 *
 * Created on Apr 16, 2010, 3:13:23 PM
 */

package fxgreader;
import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.Cursor;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.TextAlignment;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.Group;

/**
 * @author perkintang
 */

public class TipText extends CustomNode{
public var text : String;
public var t : Text = Text {
                        font: Font { size: 20 }
                        fill : Color.BLACK
                        content : bind text
                        translateY :  bind background.width/2 - t.boundsInLocal.width/2 - t.layoutBounds.minY
                        };
def background = Rectangle {
                    translateY: 0;
                    translateX: 0;
                    fill : Color.WHITE
                    width:  bind t.boundsInLocal.width + 4  height: bind t.boundsInLocal.height + 4
                    arcWidth: 10  arcHeight: 10
         };

override protected function create () : Node {
    Group{
        content : [background,t]
    };
}
}
